home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 1 / Gold Medal Software Volume 1 (Gold Medal) (1994).iso / prog / dasv10_.arj / ONEDIE.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-13  |  376 b   |  19 lines

  1. // dice.lib function one_die()
  2. #include <dos.h>
  3. #include <iostream.h>
  4. #include <stdlib.h>
  5.  
  6. int one_die(int size,int time,int display,char string2[30])
  7. {
  8.     int onedie,i;
  9.  
  10.     for (i=1;i<=10;i++) {
  11.     onedie = 1 + rand() % size;
  12.     if (display == 0)
  13.         cout<<string2<<"?   \r";
  14.     else if (display == 1)
  15.         cout<<string2<<onedie<<"   \r";
  16.     delay(time);
  17.     }
  18. return onedie;
  19. }